<h1>New resource</h1>

<%= error_messages_for :resource %>

<% form_for(@resource) do |f| %>
  <p>
    <b>Title</b><br />
    <%= f.text_field :title %>
  </p>

 <p>
	<b>User</b><br />		
  	<% if session[:user_id] != nil then %>
		<%= @user.username %>
		[<%= link_to 'logout', "/logout" %>]
	<% end %>
</p>
  
    <p>
    <b>Link</b><br />
    <%= f.text_field :link %>
  </p>

  <p>
  video: <%= check_box_tag 'video' %>
  audio: <%= check_box_tag 'audio' %>
  text: <%= check_box_tag 'text' %>
  </p>
  
  <p>
    <b>Description</b><br />
    <%= f.text_area :description %>
  </p>

  <p>
    <%= f.submit "Create" %>
  </p>
<% end %>

<%= link_to 'Back', resources_path %>
